import socket

c_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
server_address = ('192.168.0.104', 8081)  # 确保这是服务器的正确IP地址

try:
    c_socket.connect(server_address)
    print("连接成功")
    c_socket.send("你好呀".encode())
    response = c_socket.recv(1024)
    print("服务器回复:", response.decode('utf-8'))
except socket.error as e:
    print("连接失败:", e)
finally:
    c_socket.close()